070 live how to make onoff and proportional control logic in liquid level control
好吧……所以,是的,在这个视频中,我们将了解如何在液位控制中制作比例逻辑,这是今天的最后一课?
Alright ...so yeah in this video we are going to understand How to make a proportional logic in the liquid level control that is the last lesson of today?
但我会向您简要介绍一下什么是比例控制。
But I'll give you a brief what is that proportional control.
所以这是一个小演示,然后我们将对其进行编程......
So this is a small demo and then further we will program it...
所以如果你看到这里我们现在的水平是 2.9 好吗?
so if you see here we have this level right now at 2.9 okay?
&这个电位计是我的设定点(SP),我可以从这里改变它。
& this potentiometer is my Set point (SP) which I change from here okay.
这是填充阀,其开度为 0%,这意味着它已关闭,排出阀也为 0% 打开,这意味着它已关闭。
This is the fill valve which is 0% open which means it's closed also the discharge valve is 0% open which means it's closed.
所以我们从顶部填充,从底部排出......有一个液位计,其指示在这里是2.9,这意味着29%可以。
So we have the filling from the top and discharge from the bottom ...there is a level meter whose indication is here 2.9 which means 29% all right.
现在,如果我说水箱中需要更多的水,我将增加设定点,将其设置为 6.2,您可以看到(填充)阀 100% 打开,并且该值正在增加,并且随着达到设定点,阀门打开是按比例减少的。
Now if I say I need more water in the tank I will increase my set point I make it to 6.2 and you can see the (fill) valve is 100% open and this is increasing and as this is reaching to the set point the valve is proportionally decreasing.
好的,这是自动的,因此该阀门的填充现在已关闭。
Alright this is automatic so the filling of this valve is getting closed now.
一旦达到6.2的水平。
Once it reached the level which is 6.2.
现在,如果我说我想降低水位,您会看到排水阀按比例打开,一旦达到设定点,排水阀就会关闭。
Now if I say I want to decrease the level you will see drainage valve is open proportionally and this is going to close once I reach the set point.
因此,这称为比例控制,如何使用比例逻辑按比例控制阀门的驱动。
So this is called proportional control how you can control the actuation of your valve proportionally using a proportional logic.
这就是我们今天要学习的内容,但是今天的第一个目标是我们必须以百分比 (%) 的形式缩放 TIA 中的电平表 ID30,所以今天的第一个任务是如果您在这里看到我们有这个电平表,我们必须衡量其价值...
This is what we are going to learn today however the first objective of today is we have to scale the level meter ID30 in TIA in percentage (%) so the first task of today is if you see here we have this level meter we have to scale its value...
现在该值的范围是 0 到 10,现在是 4.6,最大级别将是 10,最小级别将是 0?
right now the value is from the range 0 to 10 right now it's 4.6 at maximum levels will be 10 and minimum it will be 0?
所以我们必须将该值缩放为 0 到 10 - 到 0 - 100%,高度为 0 到 300 厘米...所以如果你看到这里,这里提到的高度是 300,如果你看到底部,它是 0 ,所以我们必须缩放这个值,并且我们必须看看如何在 TIA 中做到这一点。
so we have to scale this value in 0 to 10 - to 0 - 100% and the height which is 0 to 300 centimeter ...so if you see here the height is mentioned here this is 300 and if you see the bottom its 0, so we have to scale this value and we have to see how we can do that in TIA.
学生-我可以问你一个问题吗?
Student - Can i ask you a question?
教练:当然可以吗?
Instructor: Yeah sure okay?
学生:先生,ID30是什么?
Student: Sir, what is ID30?
好吧,是吗?
OK, Yeah?
ID30 是我的...如果您转到这里驱动程序 ID30 是一个寄存器,我们在其中连接了电平表,因此电平表的值将进入 PLC 内部的寄存器中,即
ID30 is my ...if you go to here drivers ID30 is a register where we have connected a level meter so the value of level meter will come in a register which is inside the PLC i.e.
ID30和我们现在不需要的电位器我将把它删除然后在输出中我们有一个填充阀,我们有一个排水阀或排放阀,它们各自的寄存器是QD30和QD34?
ID30 and the potentiometer which we don't need right now I'll remove it then in the output we have a fill valve and we have a drainage valve or discharge valve and their respective register is QD30 and QD34?
现在这个“I”代表输入“D”代表双精度,这就是为什么在 QD30 之后它是 QD34,因为它占用了四个寄存器 - 30、31、32、33 类似地,这里这个双精度寄存器占用了四个寄存器 30、31、32、33 ?
Now this 'I' represent input 'D' represent double so that's why after QD30 it is QD34 because it's occupying four registers - 30, 31, 32, 33 similarly here this double register occupy four registers 30, 31, 32, 33 ?
好吧,这个寄存器是 64 位的,这就是为什么一个是 16 位的集合。
Okay this register is of 64-bit that's why one is the set of 16 bits..
所以是 4 的倍数..它是 64,所以它占用了四个寄存器,好吗?
so multiple of 4 ..it's 64 so it's occupying four registers okay?
所以任务说我们必须缩放 ID30 的值,这意味着电平表?
So the task says we have to scale the value of ID30 which means the level meter?
那么我们将回到 PLC,我们必须将其写入 SCL 中,好吗?
So we'll go back to our PLC and we have to write this in SCL okay?
因为我们正在学习如何用SCL编写代码,SCL是西门子广泛使用的一种编程语言..
Because we are learning how to write a code in SCL which is a programming language in Siemens widely used ..
让我们看看如何做到这一点,因此第一步是,如果您在程序块上,则必须单击并单击“添加新块”,然后转到“功能”并采用 SCL 语言,或者您可以选择梯形图和 FBD 也是如此,但是转到 SCL 并单击“确定”?
so let's see how we can do that so for that the first step is if you're on the program block you have to click and click 'add new block' and go to 'functions' and take a SCL language or you can select ladder and FBD as well, but go to SCL and click ok?
一旦你点击“确定”,你会发现这个窗口,这个窗口来自这个块,我们也可以重命名这个块并将其命名为缩放?
Once you click 'OK' you will find this window and this window is from this block and we can also rename this block and name it as scaling?
因为在这里我们将创建我们自己的函数,所以该函数表示您必须将值缩放到 100%。
Because here we are going to create our own function right so the function says you have to scale the value to 100%.
现在我们知道我们的 ID30 的值是 0 到 10...
Now we know that right here our ID30 is getting a value of 0 to 10...
我们需要将其缩放到 0 到 100% 好吗?
we need to scale it to 0 to 100% okay?
所以简单的逻辑是我们需要一个 10 的乘法因子,因为如果你将 10.0 乘以 10,它就是 100...
So the simple logic is we need a multiplication factor of 10 because if you multiply 10.0 with 10 it is 100...
所以我们能做的就是我们必须首先定义一些变量,这样在输入中我们就有了......
so what we can do is we have to first define some variables alright so in the input what we have..
我们有来自传感器的值。
we have the value coming from sensor.
好吧,来自传感器的值是真实的,因为如果你看到这里,它就表明这是一个真实的值。
Alright, and that value which is coming from sensor is in real because if you see here it says it's a real value.
因此,您必须将数据类型设置为“真实”,传感器可以写为“ID30”,可以写为“传感器”,可以写为“超声波”或任何输入,这与您在此处给出的名称无关。
So you have to make the datatype - 'real', the sensor you can write 'ID30' you can write 'sensor' you can write 'ultrasonic' or whatever input this is irrelevant what name you give here.
现在我们需要一个输出,因为缩放后您需要显示该值,因此这里我们将编写“缩放传感器”,这是一个缩放值,以百分比形式表示,这也将是实际值。
Now we need an output because after scaling you need to show the value so here we will write 'scaled sensor' this is a scaled value which will be in percentage and this will also be in real value.
所以我们定义了两个变量,所以我们必须将输入乘以 10 并存储在输出中。
So we have defined two variables so we have to multiply input with 10 and store in the output.
学生-我们还有其他数据类型选择吗?
Student- Do we have other options for datatype?
教练-是吗?
Instructor- Yes?
当然是的,我们这里有所有选项吗?
of course yeah we have it here all the options?
我们有‘实数’、‘字’、‘整数’、‘双精度整数’、‘时间’,这是硬件接口‘、‘字符’、‘布尔’、‘字节’..
We have 'real', 'word', 'integer', 'double integer', 'time' and this is hardware interfaces', 'character', 'Boolean', 'byte' ..
你有所有的数据类型好吗?
you have all the data type okay?
所以现在简单的事情是你必须编写传感器,它会自动它应该自动但它没有显示......
So now simple thing is you have to write sensor and it will automatically it should automatically but it's not showing ...
但无论如何你可以写这是一个符号让我为你放大它......
but anyways you can write this is a symbol let me zoom it for you...
这是一个寻址符号,如果你拿传感器,它会自动帮你写,然后你必须添加(:=)传感器值?
this is a symbol of addressing and if you take sensor it will automatically help you to write it and then you have to add (:=) of sensor value?
对不起...
Sorry...
这会来对吗?
this will come to the right?
这里将出现“缩放值”,因为输出位于左侧。
Here will come 'scaled values' because the output comes on the left.
缩放值是你的传感器的10倍好吗?
Scaled value is your 10 multiple of sensor okay?
因此,无论您与传感器相乘什么,都将在您的缩放传感器中,并且您必须编写分号(;),因此一旦编写此代码,当您返回主逻辑时,只需将缩放函数拖到此处,您将看到自己的自定义块在这个块中你有这个编码。
So whatever you multiply with sensor will be in your scaled sensor and you have to write semicolon (;) so once you write this code and when you go back to your main logic just drag the scaling function here and you will see your own customized block and in this block you have this coding.
那么您已经创建了自己的函数并在主逻辑中使用它?
So you have created your own function which you are using in your main logic?
现在这里的传感器是什么,我们的传感器是“ID30”,所以只需输入 ID30 和输出。
Now here what was the sensor our sensor was 'ID30' so just put ID30 and the output.
现在,您可以在数据寄存器中使用输出,或者如果您返回到您的环境,我可以为您提供另一个选项,我们可以在此处的数字显示器中显示该值。
Now the output you can use in a data register or I can give you one more option if you go back to your environment we can put we can display this value in a digital display here.
在这里,我可以将其重命名为“% 级别” - 这是返回到驱动程序的百分比级别,我们有两个输出来增加这些输出,转到配置,这是模拟输出 make - 3 ..再回到这里,然后这是百分比水平..
Here I can rename that to 'level in %' - This is level in percentage go back to drivers and we have two outputs to increase these outputs go to configuration and this is the analog outputs make - 3 ..go back here one more and here this is the level in % ..
将这个连接到您的额外输出,这是 QD38,它位于“双精度”中。
connect this one to your extra output and this is QD38 and this is in 'double int'..
所以只要去你的PLC - 只要写QD38就可以了?
so just go to your PLC - just write QD38 okay?
现在让我们在 PLC 中下载这个逻辑并看看结果?
now let's download this logic in our PLC and let's see the results?
好吧...所以现在你可以看到这是级别的某个百分比,这里级别为 0.0 让我们开始这个过程好吗?
Alrght ...so right now you can see this is some percentage of level and here level of 0.0 let's start the process okay?
我将在这里强制使用该值,因为里面没有比例值......
I will just force the value here because you're not having proportion value inside...
我们必须确保这应该工作是的“QD38”在这里哦等一下我也应该更改它的数据类型?
we have to make sure this should be working yeah 'QD38' is here oh wait a second I should change its data type as well?
在这里,您有一个转换选项,可以将某些内容从实数转换为整数,因为我们的值是实数。
here you have a conversion option to convert something from real to integer because our value was in real..
所以我们可以在这里写“缩放传感器”,这又是一个转换选项 DINT ..
so we can write here 'scaled sensor' this is a conversion option again DINT ..
好的 ...
okay ...
应该可以,让我尝试一件事,让我检查一下他们在 PLC 中获得了多少价值?
it should work okay let me try one thing let me check how much value they're getting in PLC?
然而,我们在这里获取的是百分比值,但在显示器中使用实际值有一些限制,但如果您在 HMI 中使用,这只是一个软件。
However we are getting the value in percentage here but there's some restriction in using the real values in the display but if you use in HMI this is just a software..
如果您使用 HMI,您可以在此处读取以百分比表示的值?
if you use an HMI and you can read here the values coming in percentage?
因此,也许您可以忽略软件部分,但我们在 PLC 中获取以 % 表示的值。
So maybe you can ignore the software part but we are getting the value in % in our PLC..
我们可以在 HMI 中显示..
which we can display in the HMI ..
但这只是一个软件错误,因为我无法将这个软件整数更改为我想要的真实值,但这不是这里的选项,所以我将其放在这里好吗?
but this is just a software bug because I cannot change this integer of software to real which I want but this is not an option here so I will just put that here okay?
你们抓到我了吗?
Are you guys getting me?
好吧,任务一是获得百分比?
Okay so the task one was to have percentage?
现在第二个缩放是高度,从 0 到 300 好吗?
Now the second scaling was in height which is zero to 300 okay?
现在我们必须回到我们的缩放逻辑,我们还必须将其缩放在 0 到 300 的范围内?
Now we have to go back to our scaling logic and we have to also scale this in range of 0 to 300?
现在你能猜到如何将 0 - 10 的值缩放到 0 - 300 吗?
Now how can you scale the value of 0 - 10 to 0 - 300 can you guess?
伙计们,你在我身边吗?
Guys are you there with me ?
嗨凯文..
Hi Kevin..
是的,好吧,你能猜一下如何将值从 0 - 10 缩放到 0 - 300 吗?
so yeah all right so can you guess how can you scale the value to 0 - 300 from 0 - 10?
我们在 PLC 中获得 0 到 10 伏的电压,我们需要以厘米为单位显示范围,因此您必须将 0 -10.0 的范围转换为 0 - 300?
We are getting 0 to 10 volts in the PLC any we need to show the range in centimeter so you have to convert the range of 0 -10.0 to 0 - 300?
学生-乘以30?
Student - Just multiply with 30?
是的,我们只需要相乘,所以我将再获取一个输出,因为现在它的“以厘米为单位缩放”也是真实的,在这里您将把输出放在第一个“以厘米为单位的缩放”,这相当于您的ID-传感器。
Yeah we just have to multiply so I will take one more output because right now it's 'scaled in cm' that is also real and here you will put the output first 'scale in cm' which is equivalent to your ID- the sensor..
即 ID30 乘以 30。
which is ID30 multiplied by 30.
就是这样,因为这里的值为 10,所以我们需要值 300,所以如果您看到乘法因子 300 除以 10 就是 30..
That's it, because of the value is 10 here we need the value 300 so if you see the multiplication factor 300 divided by 10 is 30..
这里有 30 个,所以我们以厘米为单位进行缩放..
you have 30 here so we have scaled in centimeter ..
现在好的事情是,如果我们回到你的主要逻辑,你必须更新你的块?
now the good thing is if we go back to your main logic, you have to update your block?
所以 - 右键单击并“更新全部阻止”,然后单击“确定”,这样您的刻度就以厘米为单位,我将在数据电阻器中读取该值,该值可能是 MD30?
So - right click and 'update block all' click 'ok' so you have scales in centimeter and I'm going to read this value in a data resistor which could be MD30?
好吧,现在让我们看看以厘米为单位......
ok so let's see that now in centimeter...
所以你现在可以看到它是 190 厘米,如果你在这里看到它大约是 190 好吧,所以如果你增加它,这里的值会增加,你会看到百分比的值在这里增加,厘米也增加了?
so you can see right now it's 190 centimeter and if you see here it would be approximately 190 okay so if you increase it the value will be increased here you will see the value of percentage being increased here and also the centimeter?
好吧,这非常容易,只需缩放值即可,我们只需读取传感器并查看乘法因子,然后编写代码..
Okay this was very easy just to scale the values we have to just read the sensor and see the multiplication factor and just write the code ..
创建您自己的函数并在此处显示它。
make your own function and display it here.
我希望这部分是清楚的?
I hope this part is clear?
你看还好吧..
You see okay..
凯文?
Kevin?
你在那里?
you there?
贾斯米特?
Jasmeet?
是的,好吧,让我们继续下一个任务吧?
yeah all right so let's proceed to the next task?
在面板上显示刻度值。
Display the scales value on the panel..
然而我们尝试过,但不幸的是我们在这里的面板中没有真正的格式,所以我们无法以真实值显示它,所以我们稍后会讨论这部分所以下一个是有趣的问题,它说使用SCL 代码以这样的方式填充水箱:如果水箱液位低于 40%,我们将读取 ID30..
however we tried but unfortunately we don't have a real format in the panel here so we cannot display it in the real values so we'll come to that part of it later So the next is interesting question it says make an auto function using SCL code such that it fills the tank in such a way that if tank level is less than 40 percent we will read ID30..
如果低于 40%,我们必须将进水阀开度设为 100%?
if it is less than 40 percent we have to make the fill valve opening 100%?
现在填充墙开口是这个..这是填充阀..
Now the fill wall opening is this one ..this is the fill valve..
如果现在的水平低于 40%,这应该是百分百。
this should be hundred percent if the level is below 40 percent now is says..
如果液位在 40 到 80 之间高于 40% 且低于 80%,则填充阀开度应为 50%,如果液位高于 80%,则意味着即将填充。
if the level is above 40 percent and less than 80 percent between 40 and 80 then fill valve opening should be 50 percent and if the level is more than 80 percent it means it's about to fill..
填充阀应关闭或应为零%。
the fill valve should be closed or should be zero %.
这是我们给出的三个条件,上面写着使用切换按钮以 50% 的流量排放阀门,可以吗?
These are the three conditions we have given and it says use toggle button to drain the valve at 50 percent flow rate okay?
现在,如果您有任何疑问,可以在中间问我,我们可以使用“if-else 语句”编写这段代码,这非常简单,所以我要做的就是复制这个条件,然后将其放在这里这是缩放逻辑..
now if you have any questions regarding you can ask me in between and this code we can write using 'if-else statement' and it's very easy so what I'll do is I'll just copy this condition and we put it here so this was the scaled logic ..
我们不会中断它..我们将进行编程并创建一个新块 - 再次称为“功能块”,我们可以称其为..让我们称其为半自动或自动控制开/关。
We are not going to interrupt it..we will go to program and create a new block - again 'function block' and we can call it ..let's call it semi-automatic or automatic control ON/OFF.
这不是成比例的。这是一个开/关控制。
This is not proportional ..this is an ON/OFF control.
之后我们将按比例进行调整,所以这又是一样的..
We will come to proportion after that so this is again the same ..
window我会在这里写一条评论让你理解吗?
window and I will write a comment here for you to understand?
问题就在这里,好的,所以第一句话说,如果水平低于 40%,现在我们知道我们在寄存器中得到百分比水平,你在这里看到 QD38,这是百分比,好的,所以我们将回到自动控制,所以让我们定义输入,所以在输入中我们有百分比级别,好吧..
The question comes here okay so the first sentence says if the level is less than 40% now we know that we are getting the level in percentage in our register you see here QD38 this is in percentage okay so we will go back to automatic control so let's define the inputs, so in inputs we have level in percentage okay..
我们的输入是什么?
and what we have in input that's it?
我们必须比较唯一的输入“百分比水平”,然后我们必须写出我们的排水阀和进水阀的输出,好吗?
We have to compare the only input which is 'level in percentage' and then we have to write the output which was our drain valve and fill valve okay?
所以现在我要写“填充阀”,编写代码的第一步始终是“定义您的输入和输出”,现在百分比水平是真实的 - 提到真实...输出是实数..
So now i will write 'fill valve', the first step of writing the code is always to 'define your inputs and outputs' now the level in percentage was in real - mention real ...output was in reals ..
那么它会是真的吗?
so it will be real?
现在,如果您擅长 C++ 技能,您可能知道如何编写“if 和 else 语句”,这里也很容易,一个选择是您可以将指令转到“程序控制”并从此处使用 if-else 语法或者你可以自己写,因为我们有三个条件,所以我将采用 if else 和 else if 我们必须编写嵌套循环,好吧,所以我将采用这个并将其拖到这里,以便我们可以在这里有多个条件第一个条件是 - 如果水箱液位低于 40%,那么这里会出现“百分比液位”,所以第一个条件是 -“百分比液位”,如果小于,则输入“小于符号”百分之四十,您可以写 40.0?
Now if you are good with your C++ skills you might know how to write an 'if and else statements' It's very easy here as well one option is you can take the instruction go to 'program control' and use if-else syntax from here or you can write by ourselves so since we are having three conditions I'm going to take if else and else if We have to write nested loops okay so I will take this one and drag it here so that we can have multiple conditions here the first condition says - If tank level is less than 40 percent so here it will come 'level in percentage' so first will be - 'level in percentage' if this is less put the 'less than sign' forty percent you can write 40.0?
好的 ..
Okay ..
那么应该发生什么?
then what should happen?
它说 - 进水阀应该打开 100%?
It says- fill valve should open 100%?
现在进水阀在这里..
Now the fill valve is here..
写入 - 填充阀,它应该是 100% 的意思 (:=)。
write - fill valve it should be 100% means (:=).
现在,正如您在我们工厂 IO 中看到的那样,填充阀的值为 0 - 10V。
Now fill valve as you see in our Factory IO is having a value of 0 - 10V..
好吧,所以你不必在这里写 100 ..
okay so you don't have to write 100 here ..
只需写 10.0 并加上分号 (;) 就可以了,因为我们的阀门无法缩放到 0 到 100 %..
just write 10.0 and put semicolon (;) okay because our valve is not scale to 0 to 100 %..
我们只缩放了输入而不是输出,所以你只写 10.0?
we have only scaled the inputs not the outputs so you just write 10.0?
这会起作用..
This will work..
现在可以了“否则如果”..
it okay now 'else if' ..
如果级别大于 40.0 且小于 80.0 ..
if the level is greater than 40.0 and less than 80.0 ..
所以也许我可以复制一下..
so again maybe i can copy that ..
大于 40.0 所以我会改变这一行..
is greater than 40.0 so I will change this line..
并且小于80.0..
and less than 80.0..
所以我会复制它,现在它说..
so I will copy that and now it says ..
and ..and 是一个与门,但实际上您可以简单地听到“AND”..
and ..and is an AND gate but practically you can hear right simply 'AND' ..
这就是您可以轻松地在此编码中编写“AND”门的方法,或者您也可以编写符号(&),好吧,无论您喜欢什么,如果这低于 80% 好吧,那么应该发生什么..
this is how you can easily write 'AND' gate in this coding or you can also write the symbol (&) and okay so however you like and if this is less than 80 percent okay then what should happen..
进水阀应打开 50%?
fill valve should be 50 percent open?
所以复制这段代码放在这里 50% 就是 5.0 好吗?
So copy this code put here 50 percent is 5.0 okay?
因为比例不是 0 - 100 0 - 5?
Because again the scale is not 0 - 100 0 - 5?
否则 - 第三种情况表示如果水平高于 80%..
Else - the third situation says if the level is above 80% ..
阀门应该为 0%..阀门应该关闭,所以我将复制这部分..
valve should be 0%..valve should be OFF so I will copy this part..
80以上我也可以在这里写'Else if'会更合适..
above 80 I can also write here 'Else if' it would be more suitable..
那么阀门应该关闭..
then the valve should be closed..
只是放在这里并放在这里 0.0..
just put here and put here 0.0..
现在我们的逻辑准备好了吗?
and now our logic is ready?
这一点还有疑问吗?
Is there any doubt in this one?
好吧,这就是这三种情况的逻辑,好吧,但是我们仍然需要编写切换按钮的代码来耗尽关卡,好吗?
Ok so this is the logic for these three situations okay But we still have to write the code for toggle button to drain the level okay?
现在,如果您回到环境,我们可以使用第一个按钮..第一个启动按钮用于排水,好吗?
now if you come back to environment we can use this first button ..this first start button for draining okay?
我们来看看它的联系...
Let's see it's connections...
这没有连接到任何地方,所以我们可以连接开始按钮,好吗?
this is not connected anywhere so we can connect the start button okay?
好吧,就在这里 I0.0 好吧..
okay it's here I0.0 Okay..
所以我们必须读取 I0.0..
so we have to read I0.0..
如果按下此按钮,我们必须以 50% 开始排水……好吧,所以我们还有一个输出“排水阀”,稍后我们将给出该阀门的地址,我们只是定义变量,所以我将剪掉这个……
if this button is pressed we have to start the draining at 50% ..okay so we have one more output 'drain valve' we will give the address to this valve later we are just defining the variables so I will cut this ..
从这里剪切评论并将其放在这里,如果按钮处于打开状态,这意味着按钮是布尔值,所以我们必须接受输入,我们将写“排出输入”,好吧,我不知道..
cut comment from here and put it here okay now if button is ON which means button as a Boolean so we have to take the input and we will write 'drain input' alright I don't know..
“排水按钮”好吧,这是布尔值,因为按钮总是打开或关闭,好吗?
'drain button' okay and this is Boolean because button is always ON or OFF okay?
所以现在再次在这里会写 IF 排水按钮...
So take now here again will write IF drain button...
所以地址是正确的,你可以写相当于 1..
so the address is true you can write equivalent to 1..
1 很高那么会发生什么?
1 is high then what should happen?
排水阀应该是 50%,所以..排水阀是..现在,如果您注意到这里的这个符号,这意味着右侧的值将变为左侧的值,但如果我不使用该列,这是在比较它好的 ?
The drain valve should be 50% so ..drain valve is..now if you notice this symbol here this means the value on the right will go to the value on the left but if I don't use the column this is comparing it ok ?
排水阀是5.0?
Drain valve is 5.0?
好的,这两行是逻辑 - '如果按下按钮,则排水阀将打开 50%' 现在如果您看到此错误,此...错误出现是因为循环未关闭,所以我将写入 END_IF ..
okay so this is these two lines is the logic for - 'if the button is pressed then drain valve will be 50% Open' now if you see this error this ...error comes because the loop is not closed so i will write END_IF ..
现在循环已关闭,因此没有红色下划线,这意味着我们的代码是正确的...您也可以编译它吗?
now the loop is closed so there is no red underline it means our code is correct ...you can also compile it?
这个还可以吧..
This is okay..
现在回到主逻辑,这将您的代码拖到这里,您将看到您的块..它说“百分比水平”,“排水按钮”“填充阀”,“排水阀”..所以“百分比水平”正如我告诉过你在这里 QD38 ..只需写 QD38 和排水按钮是 I0.0 ..
now just go back to main logic and this dragged your code here and you will see your block..it's says 'level in percentage', 'drain button' 'fill valve', 'drain valve'..so 'level in percentage' as I told you was here QD38 ..just write QD38 and drain button was I0.0..
所以只需输入 I0.0 ..让我们输入填充阀和排水阀。
so just put I0.0 ..let's enter fill valve and drain valve.
填充墙是......我们可以把它......等等!?
Fill walls is ...we can put it ...wait!?
哦,它已经在这里了?
oh it's already here?
QD30为进水阀,QD34为排水阀或排出阀。
QD30 is fill valve and QD34 is drain valve or discharge valve.
就写QD30、QD34..
Just write QD30, QD34..
所以一切都好吗?
so everything is okay?
下载逻辑并让我们看看结果。
Download the logic and let's see the results.
在我们继续之前还有疑问吗?
Any doubt here before we proceed?
好的,让我们看看操作。
ok so let's see the operation.
我要走了...
I will go...
我将释放这个力,因为现在我们正在控制和发挥,所以由于液位低于 40%,您可以看到这里的液位低于 4.0 ..填充阀 100% 打开,当液位达到 4.0 到 8.0 之间时,这将是 50 % 你可以看到它变为 50%,然后级别高于 80% 或 8.0..
I will release this force because now we are controlling and play so since the level is below 40 percent you can see the level here below 4.0 ..the fill valve is 100% Open, when the level reach between 4.0 to 8.0 this will be 50% you can see it change to 50% and then the level is above 80% or 8.0..
您会注意到这将关闭吗?
you will notice this will be OFF?
有时用 SCL 编程很容易..
sometimes the programming in SCL is easy..
因为你可以创建自己的函数,并且可以轻松地修改它、更新它并以你自己的方式使用它。
because you can make your own function and you can easily modify it and update it and use it in your own way.
所以超过 80% 应该关闭。
So above 80% it should be OFF.
我们的逻辑是正确的!是的,那很好..
Our logic is correct !yeah that's pretty much okay..
对此有任何疑问吗..?
any doubt in this one ..?
这只是遵循我们在这里编写的代码,您也许可以...您也可以在这里监视,是的,如果您只是想看看,您可以...
this is just following the code which we wrote here You can maybe ...you can also monitor that here yes you can if you just want to see...
再一次你就可以看到结果..
one more time you can see that results ..
这里哪个结果是真的?
here which result is true ?
哪个是假的?
which is false?
所以这个 IF 语句是正确的..
so this IF statement is true..
这意味着液位高于 80%,因此该结果为真,这使得填充阀为 0%。
which means the level is above eighty percent so this result is true, which makes the fill valve to 0%.
好的,现在我们必须检查此处的“绿色”按钮,只需返回并查看面板,当您按下此按钮时...您会发现您的放电打开了 50%,有趣的是您会看到填充已经从 5.0 开始..
Okay now we have to check the 'green' button here just go back and see the panel and when you press this one ...you will find your discharge is open by 50% and the interesting thing is you will see the filling has been started ..by 5.0..
50%,因为液位低于 8.0,所以这里发生的情况是我们正在使用液体,它也在控制液位。所以我们在水箱中保持一定的液位,这样即使您正在使用液体......我们正在排出液体,我们的液位得以维持!?
by 50% because the level goes below 8.0 so what is happening here we are using the liquid and it is also controlling the level..so we have maintained a certain level in the tank such that even if you are using the liquid ...we are discharging a liquid our level is maintained!?
我们一直都有液体。
We have liquid all the time.
现在有趣的部分是..
Now the interesting part is..
如果我增加这个排放阀的水平..如果我把它设置为 75%...
if I increase the level of this discharge valve..if I make it like 75 percent...
那么会发生什么情况,液位会下降,因为填充率为 50%,排空 75%,液位最终会下降。
so what will happen the level will goes down because filling is 50% and draining a 75% the level eventually will go down..
所以让我们尝试编写 7.5 并下载逻辑,现在您会注意到排水不仅仅是填充......
so let's try that I will write 7.5 and download the logic and now you will notice the drainage is more than filling...
所以水平正在下降,如果它*低于 4.0 会发生什么..
so level is going down ok so what will happen if it goes *below 4.0..
按照我们的逻辑,填充将是 100%,所以即使填充超过排空,我们的液位也会保持不变,您现在会注意到吗?
the filling will be 100% as per our logic so even then if the filling is more than draining our level is maintained you will just notice now?
这就像液体的步进控制或开/关控制,这是不成比例的。
This is like a step control or ON/OFF control of liquid this is not proportional.
所以让它低于 4.0 现在你已经看到了..
So let it go below 4.0 and now you have seen..
填充是 100%,但是当它达到 4.0 以上时,它又会变成 5.0 或 50%,你看到这个东西了吗?
the filling is 100% but then again it goes to 5.0 or 50% the moment it reaches above 4.0 you see this thing?
这是缺点之一..
This is one of the disadvantage..
如果我们使用*步进控制*控制,因为我们这里有开/关情况。
if we use *Step control* control because we have ON/OFF situation here.
你明白我的意思了吗?
Are you getting me?
因此,最好的情况是我们可以避免使用比例控制,因为如果您进行开/关操作,这对设备有害。
so the best situation we can avoid using proportional control because this is harmful for the equipment if you make something ON/OFF ..
你知道,为了 100% 和 50%,我们必须对阀门进行比例控制,这样才能平稳运行。
you know to 100% and 50% we have to have a proportional control of the valve which is a smooth operation..
因此,为了避免这种情况,我们在进行比例控制之前先进行比例控制。
so to avoid this situation we go for proportional control but before going to proportional.
我希望你们能够理解这些“if 和 else”循环,否则你们进行下去会有点困难,好吗?
I want you guys to understand these loops 'if and else' otherwise it will be a little difficult for you to proceed okay?
你可以 ..
You can ..
您还可以在此处创建一个排水按钮,您可以使用低排水或快速排水。
you can also make a button here for drainage you can use like a low drainage or fast draining.
假设如果我放置这种低排水或慢排水,它应该以 25% 的速度打开阀门。
Suppose if I place this low drainage or slow drainage it should open the valve with 25 percent..
如果我点击快速排水,阀门应该打开 75%。
if I click on the fast drainage it should open the valve with 75%.
好的..
Okay..
你能做到吗?
can you do that?
你能告诉我该怎么做吗?
can you tell me how I can do it?
就像我想在这里再多一个按钮,如果那个按钮变高,排水量应该是 25% ..如果另一个按钮变高,排水量应该是 75%,这就是现在发生的情况。
like I want to have one more button here if that button goes high- the drainage should be 25% ..if the other button goes high the drainage should be 75% which is happening right now ..
但我还需要一个按钮才能支付 25%..
but I need one more button for 25%..
我应该怎么办?
what should I do?
我们必须在这里再添加一个按钮,然后我们必须编写相同的代码,如果该按钮很高,则应该是 2.5..
We have to take one more button here and then we have to write the same code if that button is high it should be 2.5..
但如果有人同时按下两个按钮,我们就必须将其互锁,那么什么都不会发生,或者您可以定义如果有人同时按下两个按钮,会发生什么?
but then we have to interlock it if somebody presses both the buttons nothing should happen or you can define what should happen if somebody press both buttons?
或者应该是百分百..我不知道?
or it should be hundred percent ..I don't know?
有了这个,您也可以定义使用“IF 和 ELSE”语句,所以也许您可以将其作为家庭作业。
With this you can define using 'IF and ELSE' statement as well so maybe you can take it as a homework..
不知道你喜不喜欢做作业..
I don't know if you like having homework..
否则我们可以继续,是的,这是自动开关控制,现在接下来的主要部分是,安排使用电位计 o- 100% 更改水位设定点,并在 SCL 中编写代码以使用以下命令实现设定点仅比例控制。
otherwise we can proceed yeah so this was automatic ON-OFF control and Now next the main part it says make an arrangement to change the set point of water levels using potentiometer o- 100% and write a code in SCL to achieve the set point using only proportional control.
自动化比例。
Automation Proportional.
现在,如果您听说过 PID 控制..
Now if you heard about PID control ..
比例是 PID 控制的一部分,如果误差的变化率非常慢,我们通常只使用比例控制......
proportional is a part of PID control and we generally use only proportional control if your rate of change of error is very slow ...
现在我的意思是什么,如果我开始填充水箱,你知道这是一个巨大的水箱,当你开始填充它时,液位会缓慢增加,所以在这种情况下,我们只能使用比例控制,它就会起作用。
now what do I mean by that here if I start filling the tank you know it's a huge tank and when you start filling it the level increases slowly so in that case we can use only proportional control and it will work.
如果我们有其他场景,例如,我在上一课中向您展示了我们有一个球,其中球通过空气流动上下移动,在这种情况下,由于重力和空气。
In case if we have some other scenario for example I have shown you in the last lesson that we have a ball in which ball moves up and down by flow of air in that case because of gravity and because of air..
球的运动非常敏感,因为它非常轻,在这种情况下我们必须使用 PID,但在这种情况下你只能使用比例控制,所以让我们回到我们的主要逻辑,我们从这里删除这个自动控制块,但不用担心该块已经在这里,我们只是不使用它,所以我将转到程序块并添加一个新块..转到功能,在这里您将编写“比例控制逻辑”...好吧,现在我们必须在这里编写如果你知道在 PID 中我们总是处理错误的话,现在就编码吧。
ball movement is very sensitive because it was very lightweight in that case we have to use PID but in this case you can only use proportional control so let's go back to our main logic and we delete this automatic control blocks from here but don't worry the block is already here we are just not using it so I'll go to program block and add a new block ..go to functions and here you will write 'Proportional Control Logic' ...okay now here we have to write the code now if you know in PID we always deal with errors..
好吧,你能告诉我在这种情况下我们的情况会出现什么错误吗?
okay can you tell me what would be the error in our situation in this situation?
任何人都可能犯什么错误?
What could be the error anyone?
控制系统中的误差是什么?
In a control system what is the error?
在任何控制系统中,我们都有一个基本控制,我们有输入,然后我们有控制器..是的,有什么区别吗?
In any control system we have a basic control where we have input then we have controller ..yeah difference?
确切地说,错误将是用户想要的和实际反馈之间的差异 - 这就是错误?
Exactly so the error will be the difference between what the user wants and what's the actual feedback - that is the error?
所以在我们的例子中,我们首先写一下如何计算误差?
so in our case let's first write How we can calculate the error?
因此,在错误中,我们需要用户输入,因此让我们定义输入,将其称为“设定点”。
So in error we need the user input so let's define the input let's call it 'set point'.
设定点是吗?
Set point is yeah ?
学生-我们需要任何反馈吗?
Student- Do we need any feedback?
教练-是的,当然反馈是液位计,液位计向我们显示液位......是反馈,因为这是给我们值的传感器,好吗?
Instructor- yes of course the feedback is the level meter the level meter which is showing us the level ...is a feedback because this is the sensor which is giving us the value okay?
正是这样我会写传感器并且这两个值都是真实的?
exactly so I will write sensor and both these values are in real?
好吧,现在错误将是两者之间的差异,所以让我们将错误定义为临时变量,因为临时变量是我们仅用于逻辑计算的变量,所以我将在这里写下错误......错误也是真实的......
okay now the error will be the difference between that so let's define the error as the temporary variable because temporary variables are those which we use just for calculations in our logic so I will write error here ..an error is also real...
凉爽的?
cool?
所以我会写错误,它应该显示..
so I will write error and it should shows the..
无论如何,误差等于设定点减去传感器..所以设定点减去传感器..这就是错误,它们应该始终在临时变量中,因为它不断变化?
anyways error is equal to set point minus sensor ..so set point minus sensor ..this is the error and they should always in temporary variables because this keeps on changing?
好吧,现在在错误发生后,您必须编写比例逻辑,现在比例逻辑意味着,如果您知道比例控制,它只会根据误差有多大来驱动输出?
Okay now after the error you have to write a proportional logic now proportional logic means if you know the proportional control it will only actuate the output based on how much is the error?
如果误差较大,它将自动使进水阀 100% 打开。
If the error is more it will automatically make the fill valve 100% open ..
如果误差较小,它将减少填充阀一定的百分比,这取决于误差,因此比例控制与误差成正比......
if the error is less it will reduce the fill valve by some percentage which depends on the error so proportional control is directly proportional to the error...
所以我们这里写的是给大家评论一下比例控制...
so what we write here is let's give a comment Proportion control...
现在在比例控制中有一个术语称为“增益”好吧,假设如果误差为 50%,比例输出为 50%,则增益为 1..
now in proportional control there is a term called 'gain' Alright suppose if the error is 50% and the proportional output is 50% the gain is 1..
好吧,但是如果你增加增益,它会很快减少误差吗?
all right but if you increase the gain it will quickly reduce the error?
好吧,这就是你如何联系增益..
Okay that's how you can relate the gain..
比例控制的增益可以帮助您快速克服误差吗?
gain of a proportional control help you to quickly overcome the error?
所以我们将看到如何改变增益,所以现在我将在这里输入一个变量“Kp”。
So we will see how we can change the gain so as of now I will give a variable here input which is 'Kp'.
Kp 是实数,这个..我发表了评论比例增益,我们将在逻辑中看到不同增益的结果,所以在比例控制中,现在我们需要一个输出,所以在这里我将输出写为..
Kp is in real and this..I put a comment proportional gain we will see the result of different gains in our logic okay so in proportion control now we need an output so here I am writing an output as ..
我们有输出排水阀好吗,我们还有输出填充阀?
we have output drain valve okay and we also have an output filling valve?
我们还将编写一个输出“u”..
And we will also write an output which is 'u'..
你知道,在我们的控制系统中,通常我们用符号“u”或字母“u”来指代PID输出或比例输出,这在控制系统中很常见,所以我将在这里写下,这是我们的比例控制器输出,即合适,但我们在这里不需要“u”,我们只需要临时“u”,因为它是计算输出,好吗?
you know in our control system generally we refer to the PID output or proportional again output by the symbol 'u' or by letter 'u' this is a common in control systems so I will write here this is our proportional controller output that would be suitable but we don't need 'u' in here we just need 'u' in temporary because it's the calculation output okay?
所以没有粘贴选项好吧..
So there is no paste option okay..
好吧,我会告诉你“u”是什么?
okay I will tell you what 'u' is?
因此,比例控制输出现在输出将为“u”,这是控制器的输出,应该等于您的误差乘以“增益”,即“Kp”,现在尝试理解如果增益为“1” ' 好吧,如果误差是 50%,控制输出将是 50%,你明白我的意思了吗?
So proportional control output now that output will be 'u' this is the output of the controller and that should be equivalent to your - error multiplied by the 'gain' which is 'Kp' now try to understand that if the gain is '1' okay and if the error is 50% the output of control will be 50% you're getting me?
如果增益为 2,控制器的输出将为 50% x 2 = 100% 它将打开阀门 100% ..
if the gain is 2 the output of controller will be 50% x 2 = 100% It will open the valve by 100% ..
但是一旦我们开始运行这些模拟,我们就会看得更清楚,那么现在输出是什么?
but we'll see more clearly once we start running these simulations so now comes the output?
现在输出我们有两个输出,所以这非常重要,你必须了解填充输出。
Now the output we have two outputs so this is really important you have to understand the filling output..
这是填充阀,它与比例控制器输出成正比,所以我只会写相当于“u”。
this is the filling valve it's directly proportional to your - proportional controller output so I will just i will just write equivalent to 'u'.
好的,因为输出直接进入填充,因为我们在设定点小于传感器时读取,这意味着……假设我的设定点为 100%,传感器为 80%,我们需要什么?
Okay because the output directly goes to filling because we are reading when set point is less than sensor it means ...suppose my set point is 100% and the sensor is at 80% what do we need?
我们需要*打开填充阀*所以误差是20%所以20%直接相当于填充阀..
We need to *turn on the fill valve* so the error was 20% so that 20% directly is equivalent to filling valve..
所以在这种情况下,这相当于你的比例输出,但这将与你的排水输出成反比,所以在排水阀中..我不会采取“u”,但我会采取“-u”。
so in this case this is equivalent to your proportion output, but this will be inversely proportional to your draining output so in draining valve..I will not take 'u' but I will take '-u'.
为什么我取“-”因为如果你的设定点...
Why did I took '-' because if your set point ...
现在尝试理解..
now try to understand..
如果你的设定点是 50% - 给你一个例子,如果设定点是 50% 并且反馈或水平是 100% 在这种情况下会出现什么错误?
if your set point let's say is 50% - give you an example if set point is 50% and feedback or level is 100% in that case what will be the error?
50 - 100 是 -50,所以如果我给排水阀“-50”,则“-”不起作用,您知道“-”将乘以这个“-”,它将是 +50,液位为 100,设定点是 50,..
50 - 100 is -50 so if I give '-50' to drain valve nothing works in '-' you know the '-' will be multiplied by this '-' it will be plus +50 and level is 100, Set point is 50,..
它应该*打开排水阀*..
it should *turn on the drain valve*..
所以排水阀将打开 50%,这里的错误是 -50,所以这将被关闭,因为如果你给填充阀提供“-”中的东西..
so drain valve will be open by 50% and here error is -50 so this will be closed because if you give something in '-' to filling valve..
它将被关闭,所以这彼此相反?
it will be closed so this works opposite to each other?
那有意义吗?
Does that make sense?
你甚至会看到它..你会看到它让我下载这个逻辑,所以这是他们需要在比例控制中编写的唯一逻辑,让我们下载这个逻辑,让我们看看结果......
You will even see it ..you will see it let me just download this logic so this is the only logic they need to write in proportional control and let's download this one and let's see the results ...
好吧,抱歉,我还必须做一件事,只需将比例逻辑拖到这里...好吧,设置点,现在设置点,让我们从面板中取出它,在这里我可以使用它作为侧点,让我们看看它连接电位计的位置(如果您愿意)我可以将其重命名为设定点以避免混淆,所以设定点是 ID34 ...所以哎呀抱歉传感器是 ID30 ..Kp 是增益所以让我输入“2.0” - 是增益 ..排水阀排水阀。 .是QD30,灌装阀是QD34,你还能确认吗?
okay oh sorry I have to do one more thing just drag your proportional logic here ...okay set point now set point let's take it from the panel and here I can use this as side point let's see where it is connected potentiometer if you want I can rename it to set point to avoid confusions okay so the set point is ID34 ...so oops sorry Sensor was ID30 ..Kp is the gain so let me put '2.0' - is the gain ..drain valve drain valve..was QD30 and filling valve was QD34 you can still confirm it?
是的,那太好了...
Yeah that's great...
好吧,一切都很酷……现在让我们去下载吧?
okay everything is cool..so now let's go to download?
哦那是什么..
Oh what is that ..
在线好吗?
ok online?
等待这里发生一些事情我想我们改变这个..
wait something happen here I think we change this one..
以前可能是MD30...
it was MD30 before maybe...
好吧,那我刷新一下吧..
okay so let me refresh it..
所以现在设定点是 0 ..
so right now the set point is 0 ..
设定点是 0,级别是 0,所以什么也没有发生,有一些噪音,所以你可以看到一些值即将到来,因为存在一些噪音,所以你可以忽略它......
set point is 0, level is 0, so nothing is happening there is some noise so you can see some value is coming because some noise is there so you can ignore that...
让我们来谈谈比例逻辑 - 上网 - 现在我要在这里给出一些设定点哎呀抱歉应该是!?
let's come to proportional logic - go online - and now I'm going to give some set point here oops sorry should be!?
哦亲爱的?
Oh dear?
好的,所以我要给出一个设定点,比如说 26%..
okay so I'm going to give a set point let's say 26%..
等待..!?
Wait..!?
我做了什么?
What did i do ?
灌装阀好不好?
Filling valve is okay?
它反向工作这是一个问题..
it's working in reverse that's a problem..
QD30,QD34 哦,抱歉,这是 QD34,它与输出不匹配..因为在 QD34 到达之前它已排空,而 QD30 在这里很酷,好吧,现在回到这个,即使看到填充阀已打开,它正在尝试填充阀门..填充水箱,它将上升到 2.6 这是液位计,这是一个设定点,因为设定点低于反馈..
QD30, QD34 oh sorry this was QD34 and it is mismatched the outputs ..because it was drained before QD34 is here and QD30 here cool okay coming back to this one all right now even see the filling valve is on and it's trying to fill the valve..fill the tank and it will go up to 2.6 this is the level meter and this is a set point and because the set point is below the feedback..
这就是为什么这会增加阀门......并且当它达到这个值时,你可以看到它成比例地减少......
that's why this is increasing the valve..and as it is reaching this value you can see this is proportionally decreasing..
为什么是因为我们的误差在减小,如果误差在减小,那么输出也在减小!?
why because our error is decreasing and if error is decreasing the output is decreasing!?
因为这与错误成正比,并且在这种情况下游戏是固定的,你得到这个了吗?
because this is directly proportional to error and the game is fixed in this case are you getting this one ?
伙计们..
Guys..
是的,让我再次解释一下,如果我将设定点增加 67%,那么这已经增加了......
yes let me just explain again if I increase the set point 67 percent this has increased...
按比例填充阀,并且随着液位的增加。
proportionally fill valve and as the level is increasing..
这是在减少,因为我说过它与误差成正比,如果您现在注意到需要时间才能达到设定点,这是一个缓慢的操作..好吧,如果您注意到它是一个,那么现在就出现了“增益”的重要性“5.8”,需要一分钟才能达到“6.7”,如果你想快速行动,你必须增加“Kp”......
this is decreasing because I said it's proportional to the error okay and if you notice now it is taking time to reach the set point this is a slow operation ..okay now there comes the importance of 'gain' if you notice that it is a '5.8' and it will take a minute to reach '6.7' if you want a quick action you have to increase the 'Kp'...
增加“增益”,所以如果您在这里看到增益为 2.0 - 现在您已经看到了正确的响应。
increase the 'gain' so if you see here Gain is 2.0- now you have seen the response right..
让我们看看如果我们需要一个较小的值会发生什么,所以我将减少设定点,现在您将看到排水已打开,因为错误在“-”中,并且当“-”与“-”相乘时排水和自动控制排水开始..
let's see what happens if we need a lesser value so I'm going to reduce the set point and now you will see draining is ON, because the error is in '-' and when the '-' multiply with the '-' of the drainage and automated control the drainage goes ON..
这就是为什么我们使用“-”来打开排水。如果您不使用“-”,排水阀和进水阀都会打开,这对比例逻辑没有任何意义?
that's why we use the '-' to make the drainage ON..if you don't use the '-' both the drainage and fill valve will be OPEN which is which will not make any sense to proportional logic?
如果不清楚..我可以再次向你解释,但如果你保持沉默..
if it's not clear..I can explain you again but if you stay silent..
我不知道你是否知道你是否得到了它,或者你是否没有得到它。
I don't know you know if you're getting it or if you're not getting it all right ..
好吧..现在让我们通过增加增益来查看响应,您会看到更快的响应,所以让我们将其设为5.0 好吧,让我们下载它,现在它就会达到这里..让我增加到8.2,您会发现它将达到很快,我的意思是错误变化率已经降低了..
all right ..now let's see the response by increasing the gain you will see a quicker response so let's make it 5.0 okay let's download it and now it's just going to reach here..let me increase to 8.2 and you will notice it will reach quickly then before I mean rate of change of error has been reduced ..
误差正在减少..
error is reducing ..
您可以看到响应速度更快了!?
you can see the response is quicker right!?
当您增加增益时会发生这种情况..
this happens when you increase the gain..
增益增加比例控制误差的减少好吗?
gain increases the rate of reducing the error in proportion control okay?
它会很快达到 8.2,但仍然成比例,这个“增益”也会影响排水现在 5.8,你可以看到排水响应有多快。
It will quickly reach to 8.2 but still proportional and this 'gain' will also affect the drainage now 5.8 you can see how quickly drainage responds is there..
让我们增加更多,让我们增加到 20,然后下载这个好吗!?
let's increase it more let's make it 20 and download this one okay!?
现在让我们增加到..
now let's increase to..
哦,对不起,我把它归零了..
oh sorry I made it zero..
好吧,你可以看到我把它设为零并且这个值正在减少所以这是......
okay you can see that I made it zero and this is decreasing So this is...
这将为空..阀门即使在值为 20 时也是 100% 打开..
this will be empty..the valve is 100% open even and when the value is 20..
但如果你在这样的水平上增加增益,那就有点问题了,我们会看到......
but if you increase the gain at such level it's a little bit problematic we will see that..
假设我们需要 18% ..这个阀门 100% 打开并快速关闭..
so let's say we need 18 percent ..this valve is 100% open and quickly closing..
我会注意到级别已增加到 1.9 ..
I will notice that level has been increased to 1.9 ..
尽管它会通过排水进行补偿,但它会出现超调,所以在比例控制中,如果您将“增益”增加得更多(超过所需),您将得到超调,让我解释一下什么是超调。
although it will be compensated by drainage but it there is an overshoot okay so in proportional control if you increase the 'gain' more (than required) you will get an overshoot let me explain you what is an overshoot here..
所以如果我们进行演示 假设你有 我这里没有纸和笔 所以我会使用 PowerPoint 来解释它 假设你的设定点是 50% 那么这就是我的设定点 好吧,我会在这里评论 50% 如果当我们第一次看到它时,我们的比例增益是..(复制)..抱歉,当 Kp 为 10 时,这几乎没问题。
so if we take a presentation Suppose you have I don't have a paper and pen here so I would explain it using the PowerPoint suppose your set point is 50% so that's my set point okay and I will put here comment 50% and if our proportional gain when we saw the first time it was ..(copy)..sorry when Kp was 10 which was pretty much okay..
我会改变它的颜色,Kp 是 10..
I will change its color and Kp was 10..
我们实际上得到了价值让我尝试一下......
we were actually getting the value let me try it try...
幻灯片放映,你知道那会很棒,所以 Kp 是 10,我需要一支笔,是的,我们正在获得值或达到完美的效果,例如......
a slide show you know that would be great so then Kp was 10 ,I need a pen yeah we were getting the value or reaching perfectly fine like..
好吧,但是当我们增加 Kp 时,这是 0..让我们想象这是 0,这是填充的输出..好吧,但是当我们增加 Kp 时,假设我们将其增加到 20..
this okay but when we increase the Kp this was 0..let's imagine this is 0 and this is the output of filling ..okay but when we increase the Kp to let's say we increase it to 20..
在这种情况下,我们会遇到像这样的超调,好吧,不需要这种超调。
in that case we had an overshoot like this one okay this overshoot is not required..
这在控制系统中是非常危险的,我们不需要超调,我们需要良好的比例控制。
this is this is very dangerous in control system we don't need overshoots we need a good proportion control..
这样它就不会超过设定点,为了避免这个区域,我们必须减少增益,这就是游戏玩法。
so that it does not overshoot the set point so to avoid this area we have to reduce the gain so that's the game play..
你在控制系统中所做的就是减少增益以减少超调。
what you do in control system you reduce the gain to reduce the overshoots.
好吧,这就是为什么我们合适的增益约为 10 到 15,如果我们这样做,您会注意到这里没有超调,因此水平为 50%,它将达到 50,并且该阀门将关闭...
Okay that's why our suitable gain would be around 10 to 15 and if we do that one you will notice there is no overshoot here so level it's 50% it will reach 50 and this valve will be closed...
它不会超过 50 或 5.0..是吗?
it will not go beyond fifty or 5.0..yeah?
你会注意到这里它会在达到 5.0 时关闭..
you will notice here it will close the moment it reach 5.0..
所以没有超调..
so there is no overshoot..
水平正好在 50%,但如果我们将其设为 20,水平将变为 5.1 或 5.2,然后它会回来,尽管..
the level is exactly at 50% but if we make it 20 the level goes to 5.1 or 5.2 and then it comes back although..
它会回来,但这不是必需的,我们不需要超调?
it comes back but that's not required we don't need overshoots?
好的,这是比例控制逻辑,如果您愿意,逻辑就在这里,您可以编写它。
okay so this was proportional control logic and the logic is here if you want you can write it..
我不知道 !?
I don't know !?
任何..与此相关的任何问题..接下来就像你必须在面板上安装一个电位计以获得增益..我认为你的麦克风有一些问题,因为我再次听自己的声音..好吧,接下来我们必须使用电位器来改变“增益”,这是最简单的一个..
Any..any questions regarding that ..The next was like just you have to install a potentiometer in panel for the gain..I think there is some problem in your mic because I'm listening my own voice again ..okay so next is we have to change the 'gain' using potentiometer that's the very easiest one ..
你只需要再输入一个输入,也许你可以复制那个输入,我会把它放在这里,直到电位计 - 我会写 KP 这是我们的增益,任务说我们必须将其达到最小和最大限制,所以最小限制让我们把它设置为“1”,因为如果你把 Kp 设置为“0”,这是不可接受的,最大限制应该是“10”,好吧,所以你必须再次编写“IF 和 ELSE”语句来使最小和最大限制介于0 到 10,为此您将在此处输入。
you just to have to take one more input maybe you can duplicate that one and I will put it here until the potentiometer - I will write KP this is our gain and the task says we have to make it to minimum and maximum limit so minimum limit let's put it '1' because if you put Kp '0' that is not acceptable and the maximum limit should be let's say '10' okay so you have to again write 'IF and ELSE' statement to make the minimum and maximum limit between 0 to 10 and for that you will take the input here..
如果你没有看到这里,你可以在你的配置中再获取一个输入,并且你有一个输入并将 Kp 放在这里,现在这是真实的..所以你必须再次在 SCL 中创建一个缩放代码来检查输入和输出范围应该只在 1 到 10 之间,好吧..1 到 10 到 1 到 50 所以回来了..
if you don't see here you can take one more input in your configuration and you have an input and put Kp here now this is in real ..so you have to again make a scaling code in the SCL to check if the input and output range should be only between 1 to 10 okay ..one to ten on one to fifty so coming back..
如果你能在这里写一个缩放比例,我想给你这个作为作业。
here I would like to give you this as a homework if you can write a scaling here..
你只需要确保输入ID38..
you just have to make sure the input ID38..
这是 0 - 10.0 ..您必须将此范围转换为 1 - 10...
this is coming in 0 - 10.0 ..you have to convert this range to 1 - 10...
那么你会怎么做,这是一种家庭作业!?
so how will you do that this is a kind of homework!?
如果你这样做那就太好了,因为接下来我们要做的事情将比今天的课程高级一点。
if you do it that would be great because next what we are going to do will be little more advanced than today's lessons.
好吧,如果您有任何疑问,可以问我,否则我们将结束会议?
Alright if you have any doubts you can ask me otherwise we will close the session?
学生-我在哪里可以获得模拟?
Student- Where i can get the simulation?
讲师-是的,非常好的问题,这是一个工厂 IO 软件,如果您想将其与西门子链接..您需要购买许可证,我可以在我们的网站上向您显示许可证信息,因为尽管如此..
Instructor- yeah, very good question this is a Factory IO software and if you want to link it with Siemens ..you need to purchase the license I can show you the license information in our website because this although..
您将获得 30 天的免费试用版,您可以从我们的网站下载。
you will have a 30 days trial version for free which you can download from our website..
如果您使用入门版,您可以尝试 30 天免费版本链接(如果应该在这里)。
if you go to the starter Edition you can try the 30 days free version link if should be here..
在这里..是的,您可以从这里下载该软件,该软件有 30 天免费试用版,但如果您想延长有效期,您可以立即购买许可证。
here ..yeah you can download the software from here which is for 30 days trial version for free but if you like to extend the validity you can purchase the license now..
如果您只想使用“控制 IO”,我们有不同的许可证,我将在这里向您展示这个逻辑,您也可以在没有西门子的情况下进行设计...
we have different license if you want to just use 'Control IO' all right I will show you here this logic you can also design without Siemens...
如果你去驱动程序去控制 IO 让我们说它..从这里开始..
if you go to the driver go to control IO let's say that its..starting your here..
您可以在该软件中制作逻辑,但问题是它仅支持功能块,就像您将拥有的功能块一样,您不会拥有我们在西门子所做的事情,该软件有很小的限制。
you can make the logic in this software but the problem is it only supports functional blocks like you will have function blocks you will not have what we were doing in Siemens this software has small limitation..
但这不是......我不知道你是否擅长FBD,你可以使用这个软件来制作PID逻辑,他们也有加减乘法和定时器,定时器,计数器,像这样的“AND”操作这就是我们的RS触发器SR触发器..
but this is not a ...I don't know if you're good with FBD you can use this software for making PID logics they're also you have addition subtraction multiplication and the timers, timers, counters like this 'AND' operation this is our RS flip-flops SR flip flops..
设置-重置,但如果您想将其与西门子连接,那么您必须有一个西门子驱动程序,这里有西门子版本,我们有两个版本,一个是终身有效,价格为 419 美元,另一个是一年许可证,售价 140 美元 所以如果你有西门子版..
Set-reset but if you like to link it with Siemens then you have to have a Siemens driver which comes here The Siemens Edition is this one we have two editions one is the lifetime validity which cost $419 and one is a one-year license which cost $140 So if you have a Siemens Edition..
您可以将您的软件与西门子硬件链接,但您只想使用模拟..正如我正在使用的那样,您也可以这样做..
you can link your software with Siemens hardware but you just want to use the simulation ..as I'm using you can also do that ..
这是定价?
this is the pricing?
所以这取决于你..
so it's up to you..
学生 - 我们需要硬件还是您可以只使用笔记本电脑?
Student- Do we need a hardware or you can just use your laptop?
您可以像这个驱动程序一样使用您的笔记本电脑,该驱动程序是西门子驱动程序,支持硬件,但也假设软件..
You can use your laptop like this driver which is a Siemens driver supports the hardware but also suppose the software..
如果您在 v5、v13 和 v14 中看到这两个外观,我在这里使用 PLC SIM,我现在没有使用任何 PLC 来解释此逻辑,我只是使用该软件,所以这取决于您是否有该软件只需安装它,您就可以链接它..
if you see these two appearances in v5, v13 and v14 I'm using PLC SIM here, I'm not using any PLC right now for this explanation for this logic I'm just using the software so it's up to you if you have the software just install it and you can link it..
现在要链接工厂 IO 的软件..与西门子 TIA,您必须在 SCL 中编写一个逻辑,我可以给您这个逻辑..只需创建一个函数,这会将您的西门子 TIA 链接到工厂 IO ..
now to link the software of factory IO..with Siemens TIA there is this one logic you have to write in SCL which is this one I can give you this logic ..just make a function and this will link your Siemens TIA to factory IO..
你现在只需在这里选择西门子PLC SIM,因为我使用的是终极版本,我有Allen Bradley、Control IO、Modbus、西门子的所有驱动程序,但如果你购买西门子,你只会看到这四个选项-徽标、300 ,PLCSIM 中为 1200。
you just have to select Siemens PLC SIM here now since I'm using the ultimate version I have all the drivers of Allen Bradley, Control IO, Modbus, Siemens but if you buy the Siemens you will only see these four options- Logo, 300, 1200 in PLCSIM.
同学-还有施耐德PLC吗?
Student- Is there Schneider PLC also?
施耐德 - 他们没有施耐德的特定模块。
Schneider- they don't have specific module for Schneider..
但我希望这可以与 Modbus TCP 和客户端服务器链接。
but i hope this can be linked with Modbus TCP and client server..
也许OPC你必须使用第三方软件,但到目前为止我认为他们没有施耐德也许他们稍后会更新软件..
maybe OPC you have to use third-party software but so far I don't think they have Schneider Maybe they will update the software later on ..
对于我们来说,这不是选择,或者您可以联系他们的控制支持。
as us now that's not the options or maybe you can contact their control support..
也许他们会帮助你链接它..
maybe they will help you to link it..
但我不确定。
but I'm not sure.
还有其他问题吗?
Any other questions?
我会在 24 小时后上传该会议,也许您可以在 Facebook 群组以及 YouTube 上找到该链接。
I would be uploading the session after 24 hours and maybe you can find the link on the Facebook group also on the YouTube.
好吧?
Alright?
谢谢您的加入...如果您高兴的话,我希望您能享受这次会议...抱歉?
So thank you for joining ...I hope you enjoyed the session if you are happy ..sorry?
你能再说一遍吗?
Can you say that again?
哦,我说过我们将在我们的 Facebook 群组以及 YouTube 中上传此视频,如果您愿意,您可以查看该视频,如果您对今天的课程感到满意,欢迎您参加下一次课程。
oh I said we are going to upload this video in our Facebook group also in the youtube if you want you can review that and for next session if you're happy with today class you are welcome to join..
抱歉下次会议...
sorry for next session...
我会将信息放在 Facebook 上,是的,好的,如果您还有其他信息,请给我留言,谢谢您的加入,我们下节课见,玩得开心吗?
I will put the information in the Facebook yeah Alright if you have anything else you get also send me a message so thank you for joining and I'll see you in the next class Have a nice time?
再见..
ciao bye ..